package org.ykh.srb.core.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 借款信息表
 * </p>
 *
 * @author ykh
 * @since 2024-03-12
 */
@Getter
@Setter
@TableName("borrow_info")
@Schema(name = "BorrowInfoEntity", description = "借款信息表")
public class BorrowInfoEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "借款用户id")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "借款金额")
    @TableField("amount")
    private BigDecimal amount;

    @Schema(description = "借款期限")
    @TableField("period")
    private Integer period;

    @Schema(description = "年化利率")
    @TableField("borrow_year_rate")
    private BigDecimal borrowYearRate;

    @Schema(description = "还款方式 1-等额本息 2-等额本金 3-每月还息一次还本 4-一次还本")
    @TableField("return_method")
    private Byte returnMethod;

    @Schema(description = "资金用途")
    @TableField("money_use")
    private Byte moneyUse;

    @Schema(description = "状态（0：未提交，1：审核中， 2：审核通过， -1：审核不通过）")
    @TableField("status")
    private Byte status;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @Schema(description = "逻辑删除(1:已删除，0:未删除)")
    @TableField("is_deleted")
    @TableLogic
    private Boolean deleted;
}
